//
// C++ Implementation: dirscanner
//
// Description:
//
//
// Author: Ernesto Barragan <ernestus *at* gmail.com>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//

/* see dirscanner.h for info*/
#include "dirscanner.h"

DirScanner::DirScanner()
{
    m_symlinks = true ;
    m_recursive = false ;
    m_nameFilter = "*" ;
    m_sorting = QDir::Name ;

}

DirScanner::~DirScanner()
{
}

/* see dirscanner.h for info*/
inline void DirScanner::setRecursive( const bool recursive )
{
    m_recursive = recursive ;
}

/* see dirscanner.h for info*/
inline bool DirScanner::isRecursive() const
{
    return m_recursive ;
}

/* see dirscanner.h for info*/
inline void DirScanner::setSymlinkFollowed( const bool flag )
{
    m_symlinks = flag ;
}

/* see dirscanner.h for info*/
inline bool DirScanner::isSymlinkFollowed() const
{
    return m_symlinks ;
}

/* see dirscanner.h for info*/
inline void  DirScanner::setNameFilter( const QString& filter )
{
    m_nameFilter = filter ;
}

/* see dirscanner.h for info*/
inline QString DirScanner::nameFilter() const
{
    return m_nameFilter ;
}


/* protected */

/* see dirscanner.h for info*/
void DirScanner::fileFound( QString filename )
{
    emit file( filename ) ;
}

/* see dirscanner.h for info*/
void DirScanner::directoryFound( QString path )
{
    emit directory( path ) ;
}

/* see dirscanner.h for info*/
void DirScanner::startScan( const QString path ) const
{
    QDir initialDir( path ) ;
    QFileInfoList dirEntries ;
//    dirEntries = initialDir.entryInfoList( m_nameFilter, m_filters, sorting ) ;
}
